package com.heihx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heihx.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where openid = #{openid}")
    User getByOpenId(String openid);

    void insertUser(User user);

    @Select("select * from user where id = #{userId}")
    User getById(Long userId);

    /**
     * 统计用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
